#!/usr/bin/env python
# encoding: utf-8
"""
@author: youfeng
@email: youfeng243@163.com
@license: Apache Licence 
@file: parse_anhui.py
@time: 2016/12/22 15:07
"""
from parse.base_object import ParseObject


class prase_object_beijing(ParseObject):
    def __init__(self, **kwargs):
        ParseObject.__init__(self, **kwargs)

    '''
    http://qyxy.baic.gov.cn/gjjbj/gjjQueryCreditAction!openEntInfo.dhtml?entId=5E1450B576F143C2A5687373538543E5&credit_ticket=1F684F8393370D0028AEF97593DE7123&entNo=110000410112636&timeStamp=1482016072845
    '''

    def get_base_info(self, url, item=None):

        try:
            tail = url.split('?')[1]
            param_list = tail.split('&')
            length = len(param_list)
            base_info = {}
            for index in xrange(0, length - 1):
                split_list = param_list[index].split('=')
                base_info[split_list[0]] = split_list[1]

        except Exception as e:
            self.log.exception(e)
            return None

        return base_info
